//
//  Constants.h
//  nonghubao
//
//  Created by Fenrir on 13-10-12.
//  Copyright (c) 2013年 Chongqing Nonghubao Co., Ltd. All rights reserved.
//

#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define iOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7 ? YES : NO)
#define iOS5 ([[[UIDevice currentDevice] systemVersion] floatValue] < 6 ? YES : NO)
#define LOADIMAGE(file,ext) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:file ofType:ext]]
#define RGBCOLOR(r,g,b)                             [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:1.0f]
#define X_AND_WIDTH(frame)                          frame.origin.x + frame.size.width
#define Y_AND_HEIGHT(frame)                         frame.origin.y + frame.size.height
#define SHOPPING_ENABLE                             [[NSUserDefaults standardUserDefaults] boolForKey:@"shoppingEnable"]
//直辖市数组
#define MUNICIPALITY_DIRECTLY                       @[@"重庆", @"上海", @"天津", @"北京"]

//////////////////////////////////////
#define _L(x)                                       NSLocalizedString(x, nil)
#define _ACCOUNT_TOKEN                              [[NSUserDefaults standardUserDefaults] valueForKey:@"accountToken"]
#define _ACCOUNT_ID                                 [[NSUserDefaults standardUserDefaults] valueForKey:@"accountID"]
#define _ACCOUNT_NAME                               [[NSUserDefaults standardUserDefaults] valueForKey:@"accountName"]

// Sys Configurations
//EuphemiaUCAS-Bold
#define _SYS_FONT_009                               [UIFont fontWithName:@"STHeitiSC-Medium" size:22]
#define _SYS_FONT_008                               [UIFont fontWithName:@"STHeitiSC-Light" size:19]
#define _SYS_FONT_007                               [UIFont fontWithName:@"STHeitiSC-Light" size:18]
#define _SYS_FONT_006                               [UIFont fontWithName:@"STHeitiSC-Light" size:17]
#define _SYS_FONT_005                               [UIFont fontWithName:@"STHeitiSC-Light" size:16]
#define _SYS_FONT_004                               [UIFont fontWithName:@"STHeitiSC-Light" size:15]
#define _SYS_FONT_003                               [UIFont fontWithName:@"STHeitiSC-Light" size:14]
#define _SYS_FONT_002                               [UIFont fontWithName:@"STHeitiSC-Light" size:13]
#define _SYS_FONT_001                               [UIFont fontWithName:@"STHeitiSC-Light" size:11]

//#define _SYS_FONT_010                               [UIFont systemFontOfSize:23]
//#define _SYS_FONT_009                               [UIFont systemFontOfSize:21]
//#define _SYS_FONT_008                               [UIFont systemFontOfSize:19]
//#define _SYS_FONT_007                               [UIFont systemFontOfSize:18]
//#define _SYS_FONT_006                               [UIFont systemFontOfSize:17]
//#define _SYS_FONT_005                               [UIFont systemFontOfSize:16]
//#define _SYS_FONT_004                               [UIFont systemFontOfSize:15]
//#define _SYS_FONT_003                               [UIFont systemFontOfSize:14]
//#define _SYS_FONT_002                               [UIFont systemFontOfSize:13]
//#define _SYS_FONT_001                               [UIFont systemFontOfSize:11]

#define _SYS_STORAGE_URL                            [NSHomeDirectory() stringByAppendingPathComponent:@"/Documents/v1.sqlite3"]

#define _SYS_COLOR_BACKGROUND                       [UIColor colorWithRed:225/255.0 green:232/255.0 blue:244/255.0 alpha:1.0f]

#define _SYS_COLOR_001                              [UIColor colorWithRed:63/255.0 green:77/255.0 blue:0/255.0 alpha:1.0f]
#define _SYS_COLOR_002                              [UIColor grayColor]
#define _SYS_COLOR_003                              [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0f]
#define _SYS_COLOR_004                              [UIColor colorWithRed:236/255.0 green:236/255.0 blue:236/255.0 alpha:1.0f]
#define _SYS_COLOR_005                              [UIColor colorWithRed:207/255.0 green:207/255.0 blue:207/255.0 alpha:1.0f]
#define _SYS_COLOR_006                              [UIColor colorWithRed:253/255.0 green:108/255.0 blue:1/255.0 alpha:1.0f]   //#fd6c01
#define _SYS_COLOR_007                              [UIColor colorWithRed:59.0/255.0 green:59.0/255.0 blue:59.0/255.0 alpha:1.0f]   //#fd6c01

#define _SYS_NAVIGATIONBAR_TITLETEXTATTRIBUTES      [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor] ,UITextAttributeTextColor, _SYS_FONT_009, UITextAttributeFont, [UIColor clearColor], UITextAttributeTextShadowColor, nil]     //注意此处字号较大，系统默认是字有阴影的，会看起来字体模糊。要使用：清除阴影、或设置阴影偏移为(0,0)的仍中一种形式

#define _SYS_NAVIGATIONBAR_TITLETEXTATTRIBUTES_IOS7      [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor] ,UITextAttributeTextColor, _SYS_FONT_008, UITextAttributeFont, [UIColor clearColor], UITextAttributeTextShadowColor, nil]

#define _SYS_SCREEN_WIDTH                           [UIScreen mainScreen].bounds.size.width
#define _SYS_SCREEN_HEIGHT                          [UIScreen mainScreen].bounds.size.height
#define _SYS_FRAME_WIDTH                            [UIScreen mainScreen].bounds.size.width
#define _SYS_FRAME_HEIGHT                           [UIScreen mainScreen].bounds.size.height - 20

//转账
#define TRANSFER_MIN_LIMIT 100
#define PROCEDURE_FEE 2


//动态相关中的图片缩略图尺寸
#define _PICTURE_NORMAL_WIDTH              640
#define _PICTURE_NORMAL_HEIGHT             960
#define _PICTURE_NORMAL_PREVIEW_WIDTH      58
#define _PICTURE_NORMAL_PREVIEW_HEIGHT     58
#define _PICTURE_NORMAL_PREVIEW_BIG_WIDTH  300
#define _PICTURE_NORMAL_PREVIEW_BIG_HEIGHT 440
//公告
#define _PICTURE_NORMAL_ANNOUNCEMENT_WIDTH  320
#define _PICTURE_NORMAL_ANNOUNCEMENT_HEIGHT 50.5
//头像
#define _PICTURE_AVART_WIDTH               100
#define _PICTURE_AVART_HEIGHT              100
#define _PICTURE_AVART_PREVIEW_WIDTH       30
#define _PICTURE_AVART_PREVIEW_HEIGHT      30
#define _PICTURE_AVART_CIRCLE_MEMBER_WIDTH       25
#define _PICTURE_AVART_CIRCLE_MEMBER_HEIGHT      25

//压缩比
#define _PICTURE_QUALITY_AVATAR            0.1
#define _PICTURE_QUALITY_NORMAL            0.3